﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 菜单和工具
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Console.WriteLine("点击了button事件");
            textBox1.Text = textBox1.Text + "点击了button事件" + "\r\n";
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            textBox1.Text = textBox1.Text + "checkBox1发生变化，当前状态：" + 
                checkBox1.Checked + "\r\n";
        }

        private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox1.Text = textBox1.Text + "多个选择框：";
            for (int i = 0; i < checkedListBox1.Items.Count; i++)
            {
                textBox1.Text = textBox1.Text + checkedListBox1.Items[i].ToString() + ", " +
                    checkedListBox1.GetItemChecked(i) + " ";
            }
            textBox1.Text = textBox1.Text + "\r\n";
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox1.Text = textBox1.Text + "comboBox1发生变化，当前状态：" +
                comboBox1.Text + "\r\n";
        }
    }
}
